package com.qdlc.p2p.dal.mybatis.model.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.qdlc.p2p.dal.dto.Experience;
import com.qdlc.p2p.dal.model.ExperienceModel;

public interface ExperienceMapper {
    
    int countUsableExperience(long userId);
    
    List<Experience> findUsableExperience(long userId);
    
    int updateStatus(@Param("id")long id, @Param("status")int status, @Param("preStatus")int preStatus);
    
    Double sumAmount(@Param("ids")long[] ids, @Param("userId")long userId, @Param("status")int status);
    
    void experienceExpiredDispose();
    
    int checkExperience(@Param("ids")long[] ids, @Param("userId")long userId, @Param("status")int status);
    
    Double getExperienceSumByStatus(@Param("status")int status, @Param("useTime")String useTime);
    
    /**
     * 查询用户体验券
     * @param userId
     * @param status
     * @return
     */
    List<ExperienceModel> findUserList(@Param("userId")long userId, @Param("status")int status);
    
    /**
     * 条件查询列表数据
     * @param model
     * @return
     */
    List<ExperienceModel> findByModel(ExperienceModel model);
    
    /**
     * 根据用户名称模糊查询
     * @param userName
     * @return
     */
    List<ExperienceModel> findByUserName(@Param("userName")String userName);
    
    
}